package cn.yuanqiao.archive.detection.service.impl;

import cn.yuanqiao.archive.detection.domain.DetailLogs;
import cn.yuanqiao.archive.detection.mapper.DetailLogsMapper;
import cn.yuanqiao.archive.detection.service.IDetailLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 检测详情Service业务层处理
 * 
 * @author xy
 * @date 2023-08-10
 */
@Service
public class DetailLogsServiceImpl implements IDetailLogsService
{
    @Autowired
    private DetailLogsMapper detailLogsMapper;

    /**
     * 查询检测详情
     * 
     * @param id 检测详情主键
     * @return 检测详情
     */
    @Override
    public DetailLogs selectDetailLogsById(Long id)
    {
        return detailLogsMapper.selectDetailLogsById(id);
    }

    /**
     * 查询检测详情列表
     * 
     * @param detailLogs 检测详情
     * @return 检测详情
     */
    @Override
    public List<DetailLogs> selectDetailLogsList(DetailLogs detailLogs)
    {
        return detailLogsMapper.selectDetailLogsList(detailLogs);
    }

    /**
     * 新增检测详情
     * 
     * @param detailLogs 检测详情
     * @return 结果
     */
    @Override
    public int insertDetailLogs(DetailLogs detailLogs)
    {
        return detailLogsMapper.insertDetailLogs(detailLogs);
    }

    /**
     * 修改检测详情
     * 
     * @param detailLogs 检测详情
     * @return 结果
     */
    @Override
    public int updateDetailLogs(DetailLogs detailLogs)
    {
        return detailLogsMapper.updateDetailLogs(detailLogs);
    }

    /**
     * 批量删除检测详情
     * 
     * @param ids 需要删除的检测详情主键
     * @return 结果
     */
    @Override
    public int deleteDetailLogsByIds(Long[] ids)
    {
        return detailLogsMapper.deleteDetailLogsByIds(ids);
    }

    /**
     * 删除检测详情信息
     * 
     * @param id 检测详情主键
     * @return 结果
     */
    @Override
    public int deleteDetailLogsById(Long id)
    {
        return detailLogsMapper.deleteDetailLogsById(id);
    }

    @Override
    public int insertNewDetailLogs(Long pId, String message, Date detectionTime, String checkDh, String checkParentDh, String checkType, Long dId) {
        DetailLogs detailLogs=new DetailLogs();
        detailLogs.setpId(pId);
        detailLogs.setDetectionTime(detectionTime);
        detailLogs.setCheckType(checkType);
        detailLogs.setMessage(message);
        detailLogs.setCheckDh(checkDh);
        detailLogs.setCheckParentDh(checkParentDh);
        detailLogs.setdId(dId);
        return detailLogsMapper.insertDetailLogs(detailLogs);
    }
}
